package com.shop.cereshop.app.service.order.impl;

import com.shop.cereshop.app.dao.order.DlCereOrderProductDao;
import com.shop.cereshop.app.domain.TicketInfo.CereShopTicketInfo;
import com.shop.cereshop.app.service.order.DlCereOrderProductService;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import com.shop.cereshop.commons.domain.product.CereProductSku;
import com.shop.cereshop.commons.domain.product.CereShopProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description
 * @Author YF
 * @Date 日期:2021/6/23 时间:13:58
 */
@Service
public class DlCereOrderProductServiceImpl implements DlCereOrderProductService {


    @Autowired
    private DlCereOrderProductDao dlCereOrderProductDao;


    /**
     * @param orderId
     * @description:根据订单序号查询订单商品信息数据
     * @return:
     * @author:作者:YF
     * @time:日期:2021/6/23 时间:14:02
     */
    @Override
    public List<CereOrderProduct> findCereOrderProductByOrderId(Long orderId) {
        return dlCereOrderProductDao.findCereOrderProductByOrderId(orderId);
    }

    /**
     * @param productId
     * @description:根据产品序号找到产品信息表
     * @return:
     * @author:作者:YF
     * @time:日期:2021/6/23 时间:16:11
     */
    @Override
    public CereShopProduct findCereShopProductByProductId(Long productId) {
        return dlCereOrderProductDao.findCereShopProductByProductId(productId);
    }

    /**
     * @param productId
     * @description:根据商品序号拿到商品规格信息（只拿一张表，是因为票务只有一个信息）
     * @return:
     * @author:作者:YF
     * @time:日期:2021/6/23 时间:16:12
     */
    @Override
    public CereProductSku findCereProductSkuByProductId(Long productId) {
        return dlCereOrderProductDao.findCereProductSkuByProductId(productId);
    }

    /**
     * @param orderId
     * @description:根据订单序号拿到订单附属表
     * @return:
     * @author:作者:YF
     * @time:日期:2021/6/23 时间:16:17
     */
    @Override
    public CereShopTicketInfo findCereShopTicketInfoByOrderId(Long orderId) {
        return dlCereOrderProductDao.findCereShopTicketInfoByOrderId(orderId);
    }


}
